package es.ibm.santillana.mdm.webservicesdiego;

import com.ibm.pim.attribute.AttributeInstance;
import com.ibm.pim.catalog.Catalog;
import com.ibm.pim.catalog.CatalogManager;
import com.ibm.pim.catalog.item.Item;
import com.ibm.pim.context.Context;
import com.ibm.pim.context.PIMContextFactory;

public class WSEmpresaEditora {

	public String getEmpresaEditora(String primaryKey){
		Context ctxPIM = PIMContextFactory.getCurrentContext();
		CatalogManager ctmMan = ctxPIM.getCatalogManager();
		Catalog ctgArticulos = ctmMan.getCatalog("Maestro Articulos");
		Item itemPrueba = ctgArticulos.getItemByPrimaryKey(primaryKey);
		AttributeInstance attInstance = itemPrueba.getAttributeInstance("Articulos CPS/General/EmpresaEditora");
		return attInstance.getDisplayValue().toString();
	}
}
